<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-06-27 18:09:23
 * @LastEditors: voanit
 * @LastEditTime: 2022-06-29 15:33:45
-->
<template>
  <div>
    御剑乘风来,除魔天地间!===vue3==toRef==={{ obj.count }}==={{ count }}
    <button @click="btn">按钮</button>
  </div>
</template>
           
<script>
import { reactive, toRef } from 'vue'
export default {
  name: '',
  setup () {
    let obj = reactive({
      count: 1,
    })

    // toRef('目标响应式对象','目标属性')
    let count = toRef(obj, 'count')

    const btn = () => {
      // obj.count += 5
      // console.log(count, 88);
      count.value += 5
    }

    return { obj, count, btn }
  }
}
</script>
<style lang='less'  scoped>
</style>